package com.singzi.designPattern.strategyMode;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        while (true){
            Scanner input=new Scanner(System.in);
            System.out.println("*******0.输入总价*********");
            double totalPrice = input.nextInt();
            if(totalPrice <= 0) break;

            System.out.println("*******0.请选择收费方式****");
            System.out.println("*******1.正常收费*********");
            System.out.println("*******2.打八折***********");
            System.out.println("*******3.满300返30********");

            int choice = input.nextInt();
            if(choice<1||choice>3){
                System.out.println("输入错误，请重新输入");
                continue;
            }
            CashChoice cashChoice = new CashChoice(choice);
            totalPrice = cashChoice.getResult(totalPrice);
            System.out.println("实际价格为" + totalPrice);
            System.out.println("**************************");
        }


    }
}
